Efficient solution of particle shape functions for the analysis of powder total scattering data

Particle shape functions are necessary to model powder scattering data that are in the form of intensity profiles and pair distribution functions. Here, an efficient method is presented to compute particle shape functions by orientational averaging of common volume functions. Contributions from particle size and size dispersity are accounted for via scaling and convolution.


Introduction
Accurate structural information is the foundation for the development of materials for heterogeneous catalysis, semiand superconduction, sensing, and photonic and plasmonic applications (Chen et al., 2017;Luo & Guo, 2017;Billinge & Egami, 1993;Gong et al., 2015;Hajfathalian et al., 2016;Gamler et al., 2020;Leonardi & Engel, 2018). The synthesis of nanomaterials with fine microstructural features requires advances in powder scattering techniques to fully resolve the particle structure, microstructure and lattice distortion Solla-Gullon et al., 2015). Such an analysis is complicated by broadening of the small-angle scattering (SAS) component of the intensity profile due to the small size of nanoparticles, which can no longer be neglected in the analysis of powder scattering data (Scardi et al., 2011;Li et al., 2016). In particular, the shape contribution to the SAS component from particles in a powder, which are assumed to be ideally isolated, markedly affects the diffuse scattering between the Bragg peaks as well as the trend of the pair distribution function (PDF) (Olds et al., 2015). The Fourier transform (FT) of the SAS particle shape contribution, known as the shape function ðrÞ, is used for the analysis of the PDF data to account for the missing scattering information at small momentum transfer in experimental data.
The SAS particle shape contribution is commonly calculated as the orientational average of the form factor, which is the FT of the particle volume. Because orientational averaging can be solved in closed form only for a small number of shapes (Renaud et al., 2009;Bartlett & Ottewill, 1992;Svergun & Koch, 2003), numerical integration must be used to calculate the SAS particle shape contribution for other shapes (Li et al., 2011(Li et al., , 2016Senesi & Lee, 2015a). Senesi & Lee (2015b) showed that the form factor of an arbitrary polyhedron can be calculated as the sum of the form factors of simple shapes, such as tetrahedra and cubes. More recently, semi-analytic expressions for the form factors of polyhedra were derived by Wuttke (2021Wuttke ( , 2017, and implemented in the grazingincidence SAS simulation package BornAgain (Pospelov et al., 2020). Despite these advances, the solution of the shape function via FT of the SAS particle shape contribution remains generally not possible in closed form and is affected by the applied numerical approximations (Svergun & Koch, 2003). In particular, approximations at large scattering momentum transfer result in significant errors at short distances in the shape function. The SAS shape contribution can be numerically solved only for a finite range of momentum transfer. This introduces systematic errors in the shape function. Furthermore, the degree of discretization applied during numerical integration that is sufficient for an accurate SAS shape contribution within this range is generally not sufficient for an equally accurate shape function.
The shape function describes the probability of two points separated by a distance r lying within the particle. It can be calculated as the autocorrelation of the particle shape. Closedform expressions are available only for a few cases (Guinier, 1956;Azaroff, 1968;Svergun & Koch, 2003;Goodisman, 1980). A notable example is the shape function of a sphere of diameter D, sphere , which has the simple and well known form (Stokes & Wilson, 1942;Guinier & Fournet, 1955;Kodama et al., 2006;Howell et al., 2006) The sphere is a reasonable approximation when the particle shape is unknown, when features of interest in the PDF profile are only weakly affected by the average trend (Polking et al., 2012;Wang et al., 2013;Hua et al., 2015) or when the particle is significantly larger than the longest pair distance accessed via PDF methods (see Section 3.5 for more details). The sphere approximation is also employed by software applications that exploit the small-box modelling method, which approximates the PDF of a nanoparticle by the convolution of the shape function with the PDF of a bulk structure (Farrow et al., 2007). However, this approximation affects accuracy and precludes PDF methods from capturing microstructural features sensitive to particle shape effects. Common approaches to evaluate the shape function are based on the trend of the radial distribution function (RDF) (Olds et al., 2015;Leonardi, 2021;Egami & Billinge, 2003). The shape function can be approximated by a polynomial that is optimized in PDF analysis software Korsunskiy et al., 2007;Page et al., 2011). A more reliable approach is the exploitation of the duality between real-space and reciprocal-space representations of scattering data (Neder & Proffen, 2020). The intensity profile from the scattering of a powder is modelled by solving the Debye scattering equation (DSE). The shape function is then calculated as the FT of the SAS particle shape contribution (Li et al., 2011). However, the need for the solution of the DSE makes this approach inefficient. The RDF must be computed with high accuracy during the solution of the DSE for the whole particle even though the reduced experimental data are usually restricted to short pair distances, e.g. up to $4 nm (Hall & Monot, 1991;Leonardi & Bish, 2016). This limits the use of the PDF compared with other techniques for analysis of powder scattering data (Billinge & Levin, 2007). In addition, the separation of the SAS particle shape contribution from the intensity profile is non-trivial. Approximating the SAS particle shape contribution by truncation at the intensity minimum before any Bragg contribution is a popular choice and common practice when analysing experimental data (Cargill, 1971;Farrow & Billinge, 2009;Mullen & Levin, 2011). However, the tails of the Bragg peaks extend underneath the profile, causing significant errors. Although experimental data are treated the same way, different approximation errors result from contributions that are neglected by the DSE, such as the interparticle crosscorrelation. Olds et al. (2015) proposed computing an approximate shape function via convolution of the RDF for a discrete model of the particle shape with either a sinc or the shape function of a sphere. Such an approach is flexible enough in principle to describe arbitrary particle shapes. But the use of the RDF limits the application to small nanoparticles and results in significant approximation errors. Any numerical RDF only approximates a continuous region of space. Gaps between lattice sites are not accurately corrected by the convolution of the RDF with any other function. The particle shape itself is a polyhedron bounded by a fixed set of crystallographic planes. To achieve optimal computing performance, Olds et al. proposed using the same RDF to compute the shape function and for modelling the reduced experimental data. However, the RDF cannot be corrected for the lattice distortion across this model. In addition, the most frequent pair distance between nearest-neighbour lattice sites is recorded in the RDF with the largest relative error because a constant-interval histogram RDF is generally implemented in computer algorithms (Hall & Monot, 1991;Leonardi & Bish, 2016). Ultimately, in the work of Olds et al., the FT of the approximated shape function anomalously diverges from the DSE solution of perfect face-centred cubic (f.c.c.) nanocrystals for momentum transfer Q > 0.6 Å À1 despite the fact that the broadening of the nearest 220 peak and other reflections remains negligible for larger momentum transfers (e.g. Q < $ 1 Å À1 ).
Numerical methods were used to tune an analytical model of the shape function using a training set (Usher et al., 2018). The coefficients of overlapping Gaussian functions or nthorder polynomials were optimized against profiles computed across a range of particle sizes. Besides the possibility to extrapolate the solution to large nanoparticles, such a model improves accuracy by taking advantage of size-rescaling relations. However, the numerical method requires the research papers 330 Alberto Leonardi et al. Efficient solution of particle shape functions calculation of many auxiliary RDFs. This renders tuning analytical models inefficient and generally infeasible for modelling powder scattering data.
Glatter, first, and Svergun more recently proposed using a linear combination of orthogonal functions to extract the shape function via modelling of the SAS particle shape contribution by direct FT (Svergun & Koch, 2003;Glatter, 1977). Although this is a more convenient and reliable approach than the inverse FT, the arbitrary choice of the functions inevitably affects the accuracy of the derived model. Developing upon this idea, here we propose to invert the order of the operations: first solving the spherical average and then the FT of the particle volume involved in the calculation of the form factors (Senesi & Lee, 2015b;Scardi & Leoni, 2001;Leonardi et al., 2012). The FT of the particle volume and the inverse FT of the SAS particle shape contribution then cancel each other. This allows FT operations to be disregarded, thus avoiding unnecessary calculations and approximations.
In this work, we compute the shape function from the directional components known as the common volume functions (CVFs). Closed-form expressions of the CVFs are known only for a few shapes, namely sphere, hollow sphere, cube, tetrahedron, octahedron, cylinder and hexagonal prism (Stokes & Wilson, 1942;Leoni, 2019;Lele & Anantharaman, 1966;Vargas et al., 1983;Langford & Louë r, 1982;Burresi & Tapfer, 2019). Here, we also report the closed-form expression of the CVFs for hollow cubes. Furthermore, discrete CVFs are readily available for many polyhedra from tables or can be calculated with numerical algorithms for any polyhedron of interest with arbitrary accuracy (Leonardi et al., 2012;Leonardi, 2021). Compared with other methods, the use of CVFs improves accuracy of the shape function solution for arbitrary shapes and does not require the additional computation of any RDF or SAS particle shape contribution. We assess the accuracy of the shape function solution by modelling the SAS particle shape contribution to powder intensity profiles. We demonstrate that the computed shape functions accurately describe particle shape beyond resolution or size limitations. Finally, we investigate how particle size and dispersity affect the shape function.

Estimation of the shape function
The CVF describes the volume of the intersection of a shape with a copy of itself translated by a distance r along the directionn n (Scardi & Leoni, 2001;Leonardi et al., 2012). Given the shape Å of a particle, the CVF À^n n ðrÞ is proportional to the probability of a pair of sites separated by the vector r ¼ rn n lying within Å (Leonardi, 2021), The shape function is then the orientational average of the CVF over = 4 st, Due to the nonlinear and discontinuous dependence of the CVF on the observation directionn n, the analytic solution of the integral is typically not possible. We compute a numerical approximation using a weighted average of the CVFs for a discrete set of directionsn n as ( Fig. 1) The directions in these sums are either read from tables or chosen as evenly distributed over the surface of the unit sphere. If the set of directions is read from tables, their projections onto the unit sphere are used as the nodes of a triangulation. The weight factors !^n n are calculated as the surface areas of the polygons that connect the barycentres of the triangular cells that share the direction projection as one of the cell's corners. Although we use a Delaunay triangulation, the pattern of the direction projections can be adapted to best capture the particle shape with a finite set of directions. In contrast, if the set of directions is not fixed, they are sampled from a hemisphere {n n ¼ ½hkl=ðh 2 þ k 2 þ l 2 Þ 1=2 with l ! 0} at constant polar angle intervals with the zenith axis ½001. For each polar angle, a subset of directions is sampled at constant azimuthal angle intervals. The weight factors !^n n are calculated as the surface area of the portion of sphere surface in the angle range between two sequential polar and azimuthal angles. The number of azimuthal angle intervals N is then adjusted to yield an approximately constant area as Modelling the shape function for a cube of edge length $16 nm. The shape function, ðrÞ, is computed by summing the CVFs, À^n n ðrÞ, over a set of ½hkl directions. Here the CVFs for the [100], [110] and [111] directions are shown as an example. The contribution for each direction was scaled with the area fraction, !^n n , of a unit-surface-area sphere divided by a tessellation for which the projections of the directions are generator centres (schematic inset). The small-angle PDF correction in equation (6) was then computed assuming 4 0 ¼ 1, i.e. by ignoring material composition.
where ' is the polar angle and N ' is the number of polar angle intervals. The point-group symmetry of a shape can be used to constrain the angular region to sample and further optimize the computing efficiency of the algorithm. As an example, we sample the azimuthal angles only in the first octant of the hemisphere because all shapes considered in this work, as well as most nanocrystals synthesized with controlled shape methods, have at least octahedral symmetry. If a finite number of CVFs is read from tables, an auxiliary triangulation is computed for the respective set of directions. The CVF for any direction with a projection lying within one of the auxiliary triangular cells is then approximated by the linear combination of the CVFs for the directions of the projections that bound that cell using the barycentric coordinates as weights (Leonardi, 2021).

Modelling powder scattering data
We model powder scattering data in real space and reciprocal space, the PDF and the intensity profile, respectively, with the whole pair distribution function modelling (WPDFM) method (Leonardi, 2021). Although the WPDFM does not use an atomistic model of a particle, we demonstrate the reliability of the modelled powder intensity profiles against profiles simulated via full solution of the DSE. Atomistic models of Pd single-crystal f.c.c. (unit cell 3.8907 Å ) particles are built by selecting from an ideal lattice all sites enclosed in the particle shape. A set of 1000 equivalent models per shape are built by randomly shifting the particle relative to the lattice. The intensity profiles for these particle models are calculated with the software Rose-X (Debye, 1915;Leonardi & Bish, 2016), and their average is used to simulate the statistics of particles in the powder. This provides a match with the assumptions in the WPDFM method for the probability of observing a given atom pair distance in the volume of the particle shape. Given that the WPDFM estimates the RDF by exploiting the CVF, the scattering profiles and the shape function computed using equation (4) share the same accuracy and statistical approximations. The reduced PDF GðrÞ is then computed as where 0 is the average atom density and ðrÞ the pair density function (Egami & Billinge, 2003). Notably, in equation (6), the PDF gðrÞ is corrected by the inverse of the shape function, which is a constant unit for bulk-like materials.

Modelling the small-angle contribution to intensity profiles
The intensity scattered by a powder of identical isolated crystals is where Q ¼ 2jqj with the momentum transfer vector q. f is the atomic scattering factor and r ij ¼ jr j À r i j the pair distance between atoms i and j. Equation (7) is the most common formulation of the DSE. It can be rewritten as where p ðrÞ is the differential RDF for the elemental species and . Because our interest lies in the particle shape contribution, we neglect the atomic scattering factor contribution from now on and consider only the autocorrelation contribution to the intensity profiles. We assume monoatomic materials and set f ðQÞ ¼ 1. The SAS particle shape contribution is then where the shape function is integrated over the sphere due to the powder assumption. We solve equation (9) for the numerical approximation of the shape function as where ðrÞ ¼ ð m þ m rÞ for r in the mth discrete set of translation distances [i.e. r 2 ðR m ; . . . ; R mþ1 Þ] evaluated with equation (4).

Shape function solution accuracy
Errors in the calculation of the intensity profile are magnified due to the duality between reciprocal and real space. Therefore, we validate the numerical approximation of the shape function by testing the agreement between the SAS particle shape contribution to the intensity profile computed with the shape function solving equation (10) and as present for small values of momentum transfer (e.g. Q < $ 1 Å À1 ) in the powder intensity profile computed via DSE. We first probe the accuracy of our algorithm by exploiting the symmetry of a spherical shape for which À^n n ðrÞ ¼ sphere ðrÞ for alln n. For a sphere, the ideal solution of equation (9) is expressed by the Rayleigh formula (Rayleigh, 1910;Guinier & Fournet, 1955), which computes the SAS particle shape contribution normalized by the volume of the sphere (i.e. 0 ¼ 6=D 3 ) as Here, ÁðQÞ ¼ QD=2 and D is the sphere diameter. The Rayleigh formula and the solution of equation (10) are in perfect agreement [ Fig. 2(a)]. They overlap with the powder intensity profile in the limit of small momentum transfer, research papers 332 Alberto Leonardi et al. Efficient solution of particle shape functions Q < $ 1 Å À1 . For larger momentum transfer, Q > $ 1 Å À1 , the powder intensity profile grows because of the contribution from Bragg peak tails while the SAS particle shape contribution extends further down. We use a similar comparison to evaluate the reliability of the SAS particle shape contribution for other shapes that lack closed-form solutions.
We investigate the accuracy of the numerical approximation of the shape function for a cube to assess the reliability of our approach when using tabulated CVFs. The SAS particle shape contribution is calculated using either the closed-form expression of the CVFs or the discrete approximation from available tables. In particular, we use the discrete CVFs tabulated by Leonardi (2021) with a set of 163 ½hkl independent directions and h ! k ! l ! 0 (Leonardi, 2021). Errors in the intensity profiles are marginal. Approximations in the shape function yield visible, yet small, errors in the intensity profile only for large momentum transfer, Q > $ 1 Å À1 . The SAS particle shape contribution deviates from the expected trend because of the shape function error. The magnitude of noise errors and that of the deviation increase as a function of the momentum transfer and with the decrease of directional resolution of the tabulated CVFs. As a result of the summation in equation (4), these errors are inversely proportional to the number of sampled directions. In fact, the solid angle approximated by each sampled CVF increases with the decrease of directional resolution [ Fig. 2(b)]. Each CVF approximates a larger set of directions along which the particle shape and its copy do not intersect for different limit translation distances. For pair distances larger than the cube edge length, the difference between shape functions computed with a different number of directions fluctuates with wavelength and amplitude inversely proportional to the directional resolution [ Fig. 2(c)]. Such fluctuations result in a noisy error contribution to the intensity profile. Notably, this relation is reciprocal to that affecting the inverse FT of the SAS particle shape contribution. Although the shape function error may be significant in the intensity profile, the effect on the reduced PDF is usually negligible. Despite the dependence of the solution on the directional resolution for a cubic shape but not for a spherical shape, the reduced PDFs of f.c.c. nanocrystals with a different shape but identical volume perfectly overlap in the range of short pair distances [ Fig. 2(d)]. This demonstrates that a small number of directions is enough to compute an accurate shape function suitable for correcting the PDF.

Shape function solution efficiency
We measure the performance of the algorithm implementation within a standalone C library as the time required Accuracy of the SAS and shape function. Powder intensity profiles for a 20 nm spherical nanoparticle (a) and a 16 nm cubic nanoparticle (b) with f.c.c. (unit cell 3.8907 Å ) structure and identical volumes. We compare the SAS particle shape contributions computed using the shape function with powder intensity profiles simulated with the DSE and the WPDFM method. The Rayleigh solution for the spherical particle is shown as a reference. (b) The SAS particle shape contribution for the cubic particle was computed using an increasing number of directions [i.e. (@40) 40 Â 40, (@80) 80 Â 80, (@400) 400 Â 400] to approximate the shape function. (c) Shape function for the cubic particle computed using an increasing number of directions (left scale), and their difference (right scale) compared with the solution using the highest number of directions. (d) Reduced PDFs GðrÞ and negative shape function ÀðrÞ, which is the correction term in equation (6). to solve the shape function for a cubic particle using the closed-form expressions of the CVFs. A binary version of the code is available as supporting information. The size of the particle is irrelevant for performance because its effect is only a scaling factor. The computing time increases with the directional resolution and the number of points computed per shape function (Fig. 3). The relation deviates from linear for a small number of points calculated along the shape function. The apparent increase of computing time is explained by memory initialization. The computing time required to solve the shape function with sufficient directional resolution (16 609 or @80 directions) and number of points (5000) to either calculate an accurate intensity profile or correct a PDF is only 0.05 s. This allows real-time evaluation of the shape function within routines that optimize particle shape, size and their dispersion parameters.

Compact shapes
We compute the shape function and the SAS particle shape contribution to the intensity profile for various single-crystal f.c.c. nanoparticles (unit cell 3.8907 Å ). In Fig. 4, the powder intensity profiles for an octahedron, a tetrahedron, a cylindrical rod, a plate-like hexagonal prism and a concave polyhedron are shown along with the reduced PDF and the negative shape function ÀðrÞ, which is the correcting term in equation (6). The accuracy of the solutions is supported by the facts that (i) the reduced PDFs oscillate about the pair distance axis and (ii) the SAS particle shape contributions to the intensity profiles completely overlap with the powder intensity profiles for small momentum transfer and then monotonically decrease under the Bragg peaks. The SAS particle shape contribution decreases with the same power (i.e. about À4.0) for all shapes because the particles were chosen with identical volume (i.e. about 140 nm 3 ). Importantly, the solution for the concave polyhedron bounded by f311g facets using CVF coefficients from numerical tables does not show any visible error up to large momentum transfer, Q > $ 4 Å À1 . This demonstrates the accuracy of our approach to compute the shape function for arbitrary shapes including concave and convex polyhedra, rods and star shapes.
The shape functions converge to zero for a pair distance either zero or equal to the diameter of the circumsphere of the crystal shape. They are right-skewed due to the convex CVF profiles of the compact shapes. A pronounced asymmetry appears for shapes with low sphericity. The less the particle shape resembles a sphere, the more diverse the translation distances at which the CVFs along different directions converge to zero. As an extreme case, flat and elongated particles (e.g. plate-like hexagonal prisms and cylindrical rods) are described by two distinct sets of CVFs depending on the shape, exposing a thin or thick projection along the direction of observation. Although the transition is ultimately continuous, the profile of the shape function splits into two regions with an elongated right tail.
Shape functions are continuous functions. They are usually smooth functions (Zygmund, 1945;Lorentz, 2010;Chen, 2010), but jumps or cusps appear in the second derivative profile for those particles bound by parallel atomic planes [Figs. 4(a), 4(c) and 4(d)]. Sites at the particle surface are then separated by a characteristic pair distance. These sites cause the pronounced ripples marking the SAS particle shape contribution to the intensity profiles (Li et al., 2016). The frequency of the ripples is inversely proportional to the characteristic pair distance, whereas the amplitude is proportional to the integral surface of the site's sets (i.e. the particle surface area). Different sets of sites with different characteristic pair distances and about the same integral surface area cause different harmonics. For example, although the octahedron and the cylindrical rod show a single frequency [Figs. 4( f) and 4(h)], several oscillations with different frequencies combine in the SAS particle shape contribution of the plate-like hexagonal prism [ Fig. 4(i)].

Hollow shapes
Particle shapes with concentric hollow regions and uniform wall thickness represent a special class of morphology (Fig. 5). The uniform thickness of the walls results in a low-frequency modulation of the SAS particle shape contribution. The oscillation is visible against the background diffuse scattering of the powder intensity profile. We describe the closed-form expression of the CVFs for hollow sphere and hollow cube shapes by the sum of the CVFs for the envelope (À U ) and the hollow region (À V Þ minus two times their intersection (À W Þ. These CVF terms are expressed with a piecewise polynomial as Analysis of computing performance. Time required to compute the shape function for a cube with (black full dots) a variable number of directions (or polar and azimuthal angle intervals, e.g. @40 for 40 Â 40) and 10 000 points per solution, or (blue open dot) 409 033 directions (i.e. @400) and a variable number of points per solution. The best-fit linear trends are also shown (red dash-dotted line). The deviation of the fit for the shape function resolution curve is caused by a constant initialization time.

Figure 4
Reduced PDF G(r) and intensity scattering profiles from compact-shaped crystals. (a)-(e) Reduced PDF GðrÞ (blue), negative shape function ÀðrÞ, which is the correction term in equation (6)  where the size ratio between the particle envelope and the hollow region is and the H n coefficients are listed in Tables 1  and 2 for the hollow sphere and hollow cube, respectively. The CVFs of non-compact and non-convex shapes need not be monotonic. Although the volume of the intersection of a shape with its copy is positive and ultimately converges to zero, it can either decrease, remain steady or even increase with distance. This behaviour directly affects both the shape function and the SAS particle shape contribution to the intensity profiles. Compared with compact convex particle shapes, shape functions of hollow particles show a flat plateau in the range of pair distances between the wall thickness and the particle diameter minus two times the wall thickness, < r < D À 2. Within this range, the CVF curves show the largest variation, whereas outside of this range they are only weakly affected by the hollowed morphology.

Particle dispersity
The effects of particle size and size dispersity in modelled powder scattering data are captured via scaling and convolution of the CVF, respectively. Both closed-form and tabulated CVFs are commonly normalized by the shape volume and a characteristic size parameter, D, such as the diameter for a sphere or the side edge length for a cube [see Table 1 of Scardi & Leoni (2001)]. The normalized CVF zeroes at a translation distance D^n n that is directly proportional to D [i.e. À^n n ð0Þ ¼ 1 and À^n n ðD^n n Þ ¼ À^n n ðD=K^n n Þ ¼ 0] (Scardi & Leoni, 2001;Leonardi et al., 2012). The proportionality factor K^n n is a function of the directionn n. Although the directional depen-dence is lost, a similar size proportionality still applies to the shape function. For example, the shape function shown in Fig. 6(a) for a sample of cubic particles scales exactly with particle size. Both the pair distances and their probability scale linearly with D [ Fig. 6(a)]. The first scaling is due to the change in pair distance lengths that can be observed in the particle; the second scaling results from the pair distance scale factor in equation (6). Scaling the shape function affects the resolution (number of points per unit distance) and the accuracy of the calculated discrete function, making this route not a reliable option for accounting for different particle sizes. The evaluation of an accurate solution with a given resolution requires scaling the CVFs according to the target size and then solving equation (4). The broadening of the SAS particle shape contribution decreases with increasing particle size, pushing  Table 1 Coefficients for the analytical expression of the CVF for a hollow sphere.

Figure 5
Reduced PDF G(r) and powder intensity profiles from hollow-shaped crystals. (a), (b) Reduced PDF GðrÞ and negative shape function ÀðrÞ, which is the correction term in equation (6), for powders of particles with hollow spherical (a) and hollow cubic (b) shapes. The corresponding powder intensity profiles are shown in (c) and (d). SAS particle shape contributions to the intensity profiles (red) are compared with powder intensity profiles simulated with the DSE (grey) and the WPDFM (black) method.
approximation errors towards smaller momentum transfer. Therefore, to achieve a given accuracy, the number of directions considered in the calculation of the shape function has to be adapted to particle shape and size. The error is inversely proportional to the smoothness of the particle surface and proportional to the misorientation angle between neighbouring facets. Although the behaviour outlined for the cubic shape provides a suitable reference, iterative algorithms can be used to adapt the number of directions explored achieving convergence. While the CVF may be known for a finite set of  Table 2 Coefficients for the analytical expression of the CVF for a hollow cube.
SAS contribution from size, and size and shape dispersion of crystals. Reduced PDFs GðrÞ of crystals with f.c.c. (unit cell 3.8907 Å ) structure and negative shape function ÀðrÞ, which is the correction term in equation (6), for (a) monodisperse powders of cubic crystals with size ranging from $5 to $143 nm, (b) monodisperse and polydisperse powders of cubic crystals, (c) monodisperse powders of cubic, hollow cubic and a 1:1 mixture of these crystals, and (d) monodisperse powders of hollow cubic crystals and polydisperse powders of hollow cubic crystals. The short-range pair distances are magnified in the inset. The particle sizes of the monodisperse powders were chosen as the mean of the polydisperse system and the size yielding the best match of the shape functions. The left-side insets in (a) and (b) magnify the short-range pair distances. The right-side inset of (b) shows the SAS particle shape contributions to the intensity profile.
directions, interpolation methods have been proven reliable to capture the complete contribution (Leonardi, 2021). Particle dispersity can be described by summing the shape functions of each shape and size in equation (4) as where each component is rescaled by the volume Å D 3 of the particle. For a chosen particle shape Å and a given size probability distribution qðDÞ, equation (13) becomes where the normalization integral is the third moment of the size probability distribution and the integral in the numerator is the convolution of the probability distribution with the shape function. Unless the shape function is known as a closed-form expression (e.g. for the spherical shape), its discrete approximation significantly affects the accuracy of the solution. To ensure high accuracy, the order of the integrations in equation (14) and equation (4) can be switched as where the convolution in the numerator is now the same as that employed by the whole powder pattern modelling and WPDFM methods (Scardi & Leoni, 2001;Leonardi, 2021). Because CVFs are usually described by a third-order polynomial, the analytical solution is known for most common size probability distributions such as log-normal and gamma. Besides employing an analytical convolution, we calculate the shape function via numerical integration to prove the generality of the approach. Similar to any existing line profile analysis method, the computing performance and reliability of the solution are dependent on the degree of discretization. The larger the set of different sizes considered, the more partial solutions must be computed and therefore the lower the performance. Nonetheless, the finer the discretization, the better the modelled distribution can capture the size distribution in a real sample (Leoni & Scardi, 2004). The size dispersity contribution is most significant for large distances in the PDF. The larger particles in a polydisperse system set the appearance and frequency of the longer pair distances. The deviation between the shape functions for mono-and polydisperse powders with the same mean particle size increases with increasing size dispersity and pair distance length. For example, a log-normal distribution of particles with standard deviation half the mean size yields a deviation > $ 55% for a pair distance r > $ 55% of the mean particle size [ Fig. 6(b)]. A significantly larger size than the mean is required to adequately approximate the shape function of the polydisperse system. This demonstrates the danger of ignoring size dispersity effects in the analysis of PDF data. Shape dispersion yields similar artefacts. Although usually ignored, shape often changes with particle size. As an example, we consider the case of hollowed nanocrystals synthesized via galvanic replacement. The constant wall thickness yields a different size ratio, , between the particle envelope and the hollow region. A wall thickness of 3 nm for nanocrystals with envelope size from 40 to 12 nm results in a size ratio ranging from 85 to 50% [Figs. 6(c) and 6(d)].

Conclusions
We have illustrated that the shape function and the SAS particle shape contribution for a sample of nanoparticles with arbitrary shape and size can be efficiently calculated with high accuracy using CVFs. In contrast to other methods, for example the orientational average of the form factor or the trend of a whole-particle RDF (Senesi & Lee, 2015b;Olds et al., 2015;Wuttke, 2021), fits, interpolations or approximation parameters are not required. If the closed-form expressions of the CVFs are unknown, the CVF evaluated at a discrete set of translation distances and directions can be used instead. The resolution of the discretization was tuned to optimize accurate modelling of SAS particle shape contributions over a wide range of momentum transfer. The calculated scattering profiles converged to the exact solution with increasing particle shape resolution in the model description. In contrast to the approach proposed by Olds et al. (2015), the calculation of an auxiliary RDF was not required. Our approach is well suited for integration into numerical analysis tools of powder total scattering data that do not need the whole RDF. It also enables the consistent modelling of the whole powder scattering profile. Indeed, the same model information, the CVFs, can be used to model both the small-angle and the Bragg components, for example, via whole powder pattern modelling and PDF modelling methods (Scardi & Leoni, 2001;Leonardi, 2021).
We demonstrated that the size probability distribution of the polydisperse powder samples can be convoluted with the shape function. The contribution from size dispersion was accounted for at a small additional computing cost compared with the solution for a monodisperse powder. Accurate shape functions and SAS particle shape contributions to the intensity profiles were computed efficiently for powders of large nanoparticles as well as for large size dispersion. Our approach overcomes limitations of direct methods, that are particularly severe under those conditions (Neder & Proffen, 2020).
We reviewed how particle shape affects the SAS contribution to intensity profiles. CVFs are typically known in closed form or via tabulated coefficients for a wide scenario of particle shapes. In addition, we derived the analytical CVF expressions for hollowed spheres and hollowed cubes. While sinusoids in the SAS particle shape contribution can appear as a result of the truncation of the coefficient series in the FT, we showed that the source of ripples is encoded in the second derivative of the shape function. Distinct behaviours were observed in the shape function for concave and hollowed research papers shapes. Accounting for deformations of known particle shapes is left for future work.